_r_l_d, the runtime linker, exists in appropriate versions for executables
in each ABI (Application Binary Interface) available. _r_l_d is invoked
when running a dynamic executable. _r_l_d maps in shared objects used by
this executable, resolves relocations as _l_d does at static link time, and
allocates common if required.
When any dynamic executable is run, the system will first run an
interpreter which is responsible for collecting together the appropriate
objects, mapping them into memory and resolving references during
runtime. The name of the interpreter is included in the executable file.
Dynamic execution is only supported with ELF format executables. Such
executables will have an INTERP section which specifies the name of this
interpreter. The default name of this interpreter is /_u_s_r/_l_i_b/_l_i_b_c._s_o._1.
Any binary which hopes to conform to the MIPS SVR4 ABI should use the
name /_u_s_r/_l_i_b/_l_i_b_c._s_o._1 as its interpreter.
For 64-bit (64-bit ABI) programs the name of this interpreter is
/_u_s_r/_l_i_b_6_4/_l_i_b_c._s_o._1. The discussion below applies to 64-bit programs if
the directory /_u_s_r/_l_i_b_6_4 is substituted for the directory /_u_s_r/_l_i_b and
the directory /_l_i_b_6_4 is substituted for /_l_i_b.
For new 32-bit ABI programs the name of this interpreter is
/_u_s_r/_l_i_b_3_2/_l_i_b_c._s_o._1. The discussion below applies to new 32-bit ABI
programs if the directory /_u_s_r/_l_i_b_3_2 is substituted for the directory
/_u_s_r/_l_i_b and the directory /_l_i_b_3_2 is substituted for /_l_i_b.
The file /_u_s_r/_l_i_b/_l_i_b_c._s_o._1 is the standard C/system library in the form
of a shared object. In addition /_u_s_r/_l_i_b/_l_i_b_c._s_o._1 contains code which
will load the interpreter into its address space and set it to work. The
default such interpreter is /_l_i_b/_r_l_d.
One of the primary features of dynamic linking is that it gives users the
ability to change library implementations without recompiling the
executable. Some mechanisms for this are listed below. However,
/_u_s_r/_l_i_b/_l_i_b_c._s_o._1 is not subject to any of the mechanisms listed below,
since it is known to the executable as the interpreter as well as a
needed shared object. If you wish to substitute /_u_s_r/_l_i_b/_l_i_b_c._s_o._1, the
best way is to make use of the -_I flag to the linker (_l_d(1)). This can
be passed from the compiler driver using the -_W_l,-_I,_m_y_i_n_t_e_r_p_n_a_m_e format.
However, any such shared object specified must be able to act as
interpreter (or invoke _r_l_d).
_r_l_d constructs an explicit shared object list based on the information
listed in the .liblist section. For 32-bit programs, if the environment
variable ____RRRRLLLLDDDD____LLLLIIIISSSSTTTT is set, it overrides the dynamic executable's original
list (after the original list is constructed). The corresponding
environment variable for 64-bit programs is ____RRRRLLLLDDDD66664444____LLLLIIIISSSSTTTT,,,, and the one for
PPPPaaaaggggeeee 1111
RRRRLLLLDDDD((((1111)))) RRRRLLLLDDDD((((1111))))
new 32-bit ABI programs is ____RRRRLLLLDDDDNNNN33332222____LLLLIIIISSSSTTTT....
For n32 (new 32-bit ABI) or 64-bit (64-bit ABI) programs, if _RLDN32_LIST
or _RLD64_LIST is not specified, then rld will honor _RLD_LIST if
specified.
The user may include DDDDEEEEFFFFAAAAUUUULLLLTTTT in _RLD_LIST (_RLDN32_LIST/_RLD64_LIST) to
include the executable's original objlist and have rld to add new shared
objects just before and/or after it. The object list is specified as a
colon (:) separated list of shared objects. The liblists of shared
objects newly added from _RLD_LIST, _RLDN32_LIST, or _RLD64_LIST are
intentionally not processed: so it is up to the user to make the list
complete.
Because there are three distinct ABI's used by Irix programs with
accompanying libraries, there are three distinct sets of RLD search paths
and three sets of environment variables.
The default library search path for o32 (32-bit ABI) programs is
(/_u_s_r/_l_i_b:/_u_s_r/_l_i_b/_i_n_t_e_r_n_a_l:/_l_i_b), which can be overridden by either of
the environment variables ____RRRRLLLLDDDD____RRRROOOOOOOOTTTT or LLLLDDDD____LLLLIIIIBBBBRRRRAAAARRRRYYYY____PPPPAAAATTTTHHHH....
The default library search path for 64 (64-bit ABI) programs is
(/_u_s_r/_l_i_b_6_4:/_u_s_r/_l_i_b_6_4/_i_n_t_e_r_n_a_l:/_l_i_b_6_4), which can be overridden by
either of the environment variables ____RRRRLLLLDDDD66664444____RRRROOOOOOOOTTTT or LLLLDDDD____LLLLIIIIBBBBRRRRAAAARRRRYYYY66664444____PPPPAAAATTTTHHHH....
The default library search path for n32 (new 32-bit ABI) programs is
(/_u_s_r/_l_i_b_3_2:/_u_s_r/_l_i_b_3_2/_i_n_t_e_r_n_a_l:/_l_i_b_3_2), which can be overridden by
either of the environment variables ____RRRRLLLLDDDDNNNN33332222____RRRROOOOOOOOTTTT or LLLLDDDD____LLLLIIIIBBBBRRRRAAAARRRRYYYYNNNN33332222____PPPPAAAATTTTHHHH....
For n32 or 64-bit programs, if LD_LIBRARYN32_PATH or LD_LIBRARY64_PATH is
not specified, then rld will honor LD_LIBRARY_PATH if specified. As a
result, if LD_LIBRARY_PATH is set for an o32 program it is a very good
idea to also set LD_LIBRARYN32_PATH and LD_LIBRARY64_PATH to something
("" will suffice) to avoid having LD_LIBRARY_PATH apply accidentally to
n32 and 64 applications in that environment.
The search path for shared objects is acquired in the following order:
1. The path of the shared object if given in the liblist,
(i.e., if the _s_o_n_a_m_e of the shared object has a path (see _l_d(1));
2. DT_RPATH if DT_RPATH is defined in the executable or
any DSO that _r_l_d has opened.
3. Use LLLLDDDD____LLLLIIIIBBBBRRRRAAAARRRRYYYY____PPPPAAAATTTTHHHH if defined in the environment at
the time of execution;
4. The default library search path.
PPPPaaaaggggeeee 2222
RRRRLLLLDDDD((((1111)))) RRRRLLLLDDDD((((1111))))
DDDDTTTT____RRRRPPPPAAAATTTTHHHH is a colon(:) separated list of directories. DDDDTTTT____RRRRPPPPAAAATTTTHHHH in the
library search algorithm outlined above refers to the net list of paths
at the time the search is done. DDDDTTTT____RRRRPPPPAAAATTTTHHHH is actually a tag in the
._d_y_n_a_m_i_c section of a DSO or executable whose value is a string.
DDDDTTTT____RRRRPPPPAAAATTTTHHHH is set in any given DSO or the executable via the ----rrrrppppaaaatttthhhh switch
to _l_d(1) when the executable or DSO is created. Each DDDDTTTT____RRRRPPPPAAAATTTTHHHH appends to
the list of directories at the time the executable or DSO is loaded.
There is no mechanism to remove anything from the list of directories
which rrrrlllldddd builds for the executable.
LLLLDDDD____LLLLIIIIBBBBRRRRAAAARRRRYYYY____PPPPAAAATTTTHHHH is a colon(:) separated list of directories; and, if
defined, specifies an extra set of directories in which rld is to look
when searching for shared objects.
LLLLDDDD____LLLLIIIIBBBBRRRRAAAARRRRYYYY66664444____PPPPAAAATTTTHHHH and LLLLDDDD____LLLLIIIIBBBBRRRRAAAARRRRYYYYNNNN33332222____PPPPAAAATTTTHHHH are treated in a similar
fashion.
____RRRRLLLLDDDD____RRRROOOOOOOOTTTT is a colon(:) separated list of directories; and, if defined,
is appended to the front of DT_RPATH and the default path.
____RRRRLLLLDDDD66664444____RRRROOOOOOOOTTTT and ____RRRRLLLLDDDDNNNN33332222____RRRROOOOOOOOTTTT are treated in a similar fashion.
To ensure compatibility, applications may choose to disallow exec-time or
runtime library replacement. _l_d supports the -_n_o__l_i_b_r_a_r_y__r_e_p_l_a_c_e_m_e_n_t,
flag to facilitate this feature.
Security dictates that _r_l_d should not allow library replacement for
_s_e_t_u_i_d and _s_e_t_g_i_d programs unless the user is _r_o_o_t.
Users can replace the default _r_l_d binary by setting the environment
variable ____RRRRLLLLDDDD____PPPPAAAATTTTHHHH to the full path of another runtime linker. _r_l_d._d_e_b_u_g
is a version of _r_l_d that has debugging support. By setting the
environment variable ____RRRRLLLLDDDD____PPPPAAAATTTTHHHH to /usr/lib/rld.debug, it replaces the
default _r_l_d as the runtime linker, and the debugging features it supports
are available.
For 64-bit programs, the environment variable is ____RRRRLLLLDDDD66664444____PPPPAAAATTTTHHHH and the
debugging version of rld is /usr/lib64/rld.debug.
For new 32-bit ABI programs, the environment variable is ____RRRRLLLLDDDDNNNN33332222____PPPPAAAATTTTHHHH and
the debugging version of rld is /usr/lib32/rld.debug.
rrrrlllldddd also supports the environment variable LLLLDDDD____BBBBIIIINNNNDDDD____NNNNOOOOWWWW as documented in
the SYSTEM V ABI pg 5-14. If LLLLDDDD____BBBBIIIINNNNDDDD____NNNNOOOOWWWW is set to "1" or "on", then the
dynamic linker processes all relocation before transferring control to
the program, if LLLLDDDD____BBBBIIIINNNNDDDD____NNNNOOOOWWWW is set to "0" or "off", or does not occur in
the environment, then the dynamic linker is permitted to perform symbol
resolution and relocation for functions lazily, ie avoid them until the